<title>Admin | System Settings</title>
<script>
    $("ul li").each(function() {
        if ($(this).attr("key") == "adminsettings") {
            $(this).addClass("active");
        }
    });
</script>
<div id="view-content">
    <h2>System Settings</h2>
    <div class="row-fluid">
        <div class="span5 well">
            <h3>Email API Settings</h3>
            <table class="table">
                <tr>                    
                    <?php
                    foreach ($this->sendgridDetails as $value) {

                        echo "<td>";
                        if ($value->active) {
                            echo '<a class="btn btn-success disabled" title="Email are currently sending through SendGrid Email API"><i class="icon-white icon-ok-sign"></i> SendGrid Email API (Activated)</a>';
                        } else {
                            ?>
                        <a class="btn btn-inverse" href="<?= $this->url(array('id' => $value->sr), 'api-activation'); ?>" title="Click to send through SendGrid Email API"><i class="icon-white icon-info-sign"></i> Send through SendGrid Email API</a>
                        <?php
                    }
                    echo "</td>";
                    echo "<td>";

                    if ($value->active) {
                        ?>
                        <a class="btn btn-inverse" href="<?= $this->url(array('id' => $value->sr), 'api-activation'); ?>" title="Click to send through Local Server\'s mail feature "><i class="icon-white icon-info-sign"></i> Send through Local Server  </a>
                        <?php
                    } else {
                        echo '<a class="btn btn-success disabled" title="Email are currently sending through Local Server\'s mail feature"><i class="icon-white icon-ok-sign"></i> Local Server (Activated)</a>';
                    }

                    echo "</td>";
                }
                ?>

                </tr>
            </table>            
        </div>

        <div class="span5 well">
            <h3>Facebook API Settings</h3>
            <table class="table">
                <tr>                    
                    <?php
                    foreach ($this->facebookDetails as $value) {

                        echo "<td>";
                        if ($value->active) {
                            echo '<a class="btn btn-success disabled" title="Login with Facebook Enabled"><i class="icon-white icon-ok-sign"></i> Login with Facebook (Activated)</a>';
                        } else {
                            ?>
                        <a class="btn btn-primary" href="<?= $this->url(array('id' => $value->sr), 'api-activation'); ?>" title="Click to enable Facebook Login"><i class="icon-white icon-info-sign"></i> Login with Facebook</a>
                        <?php
                    }
                    echo "</td>";
                    echo "<td>";

                    if ($value->active) {
                        ?>
                        <a class="btn btn-primary" href="<?= $this->url(array('id' => $value->sr), 'api-activation'); ?>" title="Only manual login "><i class="icon-white icon-info-sign"></i> Only manual login  </a>
                        <?php
                    } else {
                        echo '<a class="btn btn-success disabled" title="Manual Login is enabled"><i class="icon-white icon-ok-sign"></i> Manual Login (Activated)</a>';
                    }

                    echo "</td>";
                }
                ?>

                </tr>
            </table>            
        </div>
    </div>


</div>